package com.xbao.controller;

import com.xbao.core.http.CommRequest;
import com.xbao.core.http.CommResult;
import com.xbao.model.StuRecordCheckReq;
import com.xbao.model.StuRecordCheckVo;
import com.xbao.model.req.CheckPeriodReq;
import com.xbao.model.req.CheckQuery;
import com.xbao.model.vo.CheckPeriodVo;
import com.xbao.service.StuRecordCheckService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.List;

/**
 * Created by qingshengzheng on 18/10/14.
 */
@Api(value = "/check", tags = "check")
@RequestMapping(value = "check")
@Controller
@EnableAutoConfiguration
public class StuCheckController extends BaseController {
    private StuRecordCheckService relService;


    /**
     */
    @ApiOperation(value = "stuRecordCheck", notes = "stuRecordCheck")
    @RequestMapping(value = "/stuRecordCheck",method = RequestMethod.POST)
    @ResponseBody
    public CommResult stuRecordCheck(@RequestBody CommRequest<List<StuRecordCheckReq>> checkPeriodReq) {
        relService.addStuRecordRels(checkPeriodReq.getData());
        return result();
    }

    /**
     */
    @ApiOperation(value = "checkTotal", notes = "checkTotal")
    @RequestMapping(value = "/checkTotal",method = RequestMethod.POST)
    @ResponseBody
    public CommResult checkTotal(@RequestBody CommRequest<CheckPeriodReq> checkPeriodReq) {
      /* CheckTotalVo vo= checkPeriodService.checkTotal(checkPeriodReq.getData());
        return new CommResult<CheckTotalVo>(vo);*/
        return null;

    }

    /**
     */
    @ApiOperation(value = "checkList", notes = "checkList")
    @RequestMapping(value = "/checkList",method = RequestMethod.POST)
    @ResponseBody
    public CommResult<List<CheckPeriodVo>> checkList(@RequestBody CommRequest<CheckQuery> checkPeriodReqCommRequest) {

        return null;
    }




    @ApiOperation(value = "getStusOfClsList", notes = "getStusOfClsList")
    @RequestMapping(value = "/getStusOfClsList",method = RequestMethod.POST)
    @ResponseBody
    public CommResult<List<StuRecordCheckVo>> getStusOfClsList(@RequestBody CommRequest<CheckQuery> checkPeriodReqCommRequest) {
            List<StuRecordCheckVo> vos=relService.relOfStu(checkPeriodReqCommRequest.getData());
        return new CommResult<>(vos);
    }













    /**
     */
    @ApiOperation(value = "waitCheckList", notes = "waitCheckList")
    @RequestMapping(value = "/waitCheckList",method = RequestMethod.POST)
    @ResponseBody
    public CommResult<List<CheckPeriodVo>> waitCheckList(@RequestBody CommRequest<CheckPeriodReq> checkPeriodReqCommRequest) {

        return null;
    }


}
